<?php


namespace App\Models;


class IndexShidao
{
    public $title = null;       // 名称，用于搜索
    public $content = null;     // 内容
    public $filepath = null;    // 文件路径
    public $url     = null;     // 访问路径

    public function data() : array {
        $info = [];
        if ($this->title !== null) {
            $info['title'] = $this->title;
        }

        if ($this->content !== null) {
            $info['content'] = $this->content;
        }

        if ($this->filepath !== null) {
            $info['path'] = $this->filepath;
        }

        // $info['url'] = $this->url;
        return $info;
    }
}
